/**
 * Created by maxiaoqiang on 2018/7/10.
 */
import React, {Component} from "react";

import { Table, Input, Icon, Button, Popconfirm, Select } from 'antd';

const { Option, OptGroup } = Select;

const columns = [
    {
        title: '年份',
        dataIndex: 'name'
    }, {
        title: '试卷名称',
        dataIndex: 'age'
    }, {
        title: '操作',
        dataIndex: 'operation',
        render: (text, record) => {
            return (
                <div>
                    <a>在线考试</a>
                </div>
            )
        }
    }
];

class PastPaper extends Component{

    constructor(props){
        super(props);
        this.state = {
            dataSource: [{
                key: '0',
                name: '2018',
                age: '一级建造师法规试卷',
            }, {
                key: '1',
                name: '2018',
                age: '一级建造师法规试卷',
            }]
        };
    }

    render(){
        return(
            <div>
                <div>
                    <Select defaultValue="lucy" style={{ width: 120 }}>
                        <Option value="2018">2018</Option>
                        <Option value="2017">2017</Option>
                    </Select>
                    <Select
                        defaultValue="法律法规"
                        style={{ width: 200 }}
                    >
                        <OptGroup label="注册建造师">
                            <Option value="jack">法律法规</Option>
                            <Option value="lucy">实务</Option>
                        </OptGroup>
                        <OptGroup label="一级建造师">
                            <Option value="jack">法律法规</Option>
                            <Option value="lucy">实务</Option>
                        </OptGroup>
                    </Select>
                    <Button type="primary" icon="search">Search</Button>
                </div>
                <Table
                    bordered
                    dataSource={this.state.dataSource}
                    columns={columns}
                />
            </div>
        )
    }

}

export default PastPaper;